$(function() {
    // 鼠标移入显示大图
    $('.big-box').on('mouseover', function() {
        $('.big').hide();
        $('.lbig').show();
        $('.big-box').on('mousemove', function(ev) {
            var left = ev.pageX - $('.big-box').offset().left;
            var top = ev.pageY - $('.big-box').offset().top;
            $('.lbig').css({
                top: -top + 'px',
                left: -left + 'px',
            })
        })
    })

    // 鼠标移除大图消失
    $('.big-box').on('mouseout', function() {
            $('.lbig').hide();
            $('.big').show();
        })
        // 选项卡
    $('.sma-pic>li').on('click', function(ev) {
        var index = $('.sma-pic>li').index(this);
        $(this).css({ 'border-bottom': '4px solid #113382' }).siblings().css({ 'border-bottom': '4px solid transparent' });
        // 点击换图片
        var imgarr = ['../img/img/goods/b1.jpg', '../img/img/goods/b2.jpg', '../img/img/goods/b3.jpg', '../img/img/goods/b4.jpg', '../img/img/goods/b5.jpg'];
        $('.big')[0].src = imgarr[index];
        var imgbigarr = ['../img/img/goods/lb1.jpg', '../img/img/goods/lb2.jpg', '../img/img/goods/lb3.jpg', '../img/img/goods/lb4.jpg', '../img/img/goods/lb5.jpg'];
        $('.lbig')[0].src = imgbigarr[index];
    })
})